//
//  Date.swift
//  iModern
//
//  Created by 赵友源 on 15/9/18.
//  Copyright © 2015年 com.starlooking. All rights reserved.
//

import Foundation

extension NSDate {
    static func DateFromJSONStringCN(jsonDateString:String)->NSDate
    {
        let formater = NSDateFormatter()
        formater.locale = NSLocale.init(localeIdentifier: "zh_CN")
        formater.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
        let date = formater.dateFromString(jsonDateString)
        return date!
    }
    
    func toNormalDate()->String
    {
        let formater = NSDateFormatter()
        formater.locale = NSLocale.init(localeIdentifier: "zh_CN")
        formater.dateFormat = "yyyy年MM月dd日"
        let strdate = formater.stringFromDate(self)
        return strdate
    }
}